/**
 * This file is released under the GNU General Public License.
 * Refer to the COPYING file distributed with this package.
 *
 * Copyright (c) 2008-2009 WURFL-Pro srl
 */
package net.sourceforge.wurfl.core.resource;

/**
 * This is a mutable {@link WURFLModel} interface. All classes need to modify
 * the model must referencing this interface.
 * 
 * @author WURFL-PRO SRL, Rome, Italy
 * @version $Id: WURFLAccessibleModel.java 1045 2009-03-09 15:52:53Z filippo.deluca $
 */
public interface WURFLAccessibleModel extends WURFLModel {

	/**
	 * Applies a patch to model runtime.
	 * 
	 * @param patch
	 *            The resource represents patch.
	 */
	public void applyPatch(WURFLResource patch);

	/**
	 * Applies several patches to model runtime.
	 * 
	 * @param patches
	 *            The resources represent patches.
	 */
	public void applyPatches(WURFLResources patches);

	// Event handling *****************************************************

	/**
	 * Add a {@link WURFLModelListener} observe this model.
	 * 
	 * @param The
	 *            listener to add.
	 */
	public void addModelListener(WURFLModelListener listener);

	/**
	 * Remove a {@link WURFLModelListener} observing this model. If the listener
	 * are not observing this model then the operation is ignored.
	 * 
	 * @param The
	 *            listener to remove.
	 */
	public void removeModelListener(WURFLModelListener listener);
}
